cmake_minimum_required( VERSION 2.8 )

project( various_IPC_things CXX )


# Set common variables
IF ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
  SET (BUILD_DIR build/release)
ELSE ()
  SET (BUILD_DIR build/debug)
ENDIF ()


# Print variables to stdout
MESSAGE ( STATUS )
MESSAGE ( STATUS "Building App:" )
MESSAGE ( STATUS "change a configuration variable with: cmake -D<Variable>=<Value>" )
MESSAGE ( STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}" )
MESSAGE ( STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}" )
MESSAGE ( STATUS "CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}" )
MESSAGE ( STATUS )


add_subdirectory( code )
add_subdirectory( extern_libs )



#project compiler flags
set ( CMAKE_CXX_FLAGS "-w -Wall -Wextra -Werror -pthread -std=c++11" 
      CACHE STRING "g++ Compiler Flags for All Builds" FORCE)

set ( CMAKE_CXX_FLAGS_DEBUG "-g -O0"
      CACHE STRING "g++ Compiler Flags for Debug Builds" FORCE)

set ( CMAKE_CXX_FLAGS_RELEASE  "-O3"
      CACHE STRING "g++ Compiler Flags for Release Builds" FORCE)


option( BUILD_UNIT_TESTS "Flag telling whether to build unit tests" OFF) 

